public class bvyuew {
    public int souguo(int target, int[] nums) {
        int len = Integer.MAX_VALUE;
        int n = nums.length, sum = 0;
        for (int left = 0, right = nums.length - 1; right < n; right++) {
         sum+=nums[right];
         while(sum>=target){
             len = Math.min(len,right-left+1);
             sum -=nums[left--];
         }
        }

        return len==Integer.MAX_VALUE?0:len;
    }
}
